{! extends "base.html" !}
{! block hscript !}
<script type="text/javascript" src="{{site.url}}js/jquery.min.js"></script>
{! endblock !}
{! block nav !}
			<a href="javascript:cclear()">Reset All</a>&nbsp;&nbsp;
			<a href="javascript:gclear()">Clear Memory Cache</a>&nbsp;&nbsp;
			<a href="javascript:dclear()">Clear Database Cache</a>
{! endblock !}
{! block content !}
<div>
		<table align="center">
			<tr>
				<td><h1>Memory Cache</h1></td>
				<td width="5%">&nbsp;</td>
				<td><h1>Database Cache</h1></td>
			</tr>
			<tr>
				<td><h2>{{memoryStat}}</h2></td>
				<td>&nbsp;</td>
				<td><h2>{{dbstoreStat}}</h2></td>
			</tr>
		</table>
</div>
{! endblock  !}
{! block bscript !}
<script type="text/javascript">
function cclear() {
 	$.ajax({
 		type: "GET",
 		url: "{{site.adminUrl}}cache/clear",
 		dataType: "json",
 		success: function(data){
 			var hmd = $("#hiddenMessage");
	    	if (data.type == "error") {
	    		hmd.html("<div class='error'>" + data.message + "</div>");
	    	} else {
	    		hmd.html("<div class='info'>" + data.message + "</div>");
	    	}
	    	hmd.show().focus();
 		}
 	});
}
function gclear() {
 	$.ajax({
 		type: "GET",
 		url: "{{site.adminUrl}}cache/memclear",
 		dataType: "json",
 		success: function(data){
 			var hmd = $("#hiddenMessage");
	    	if (data.type == "error") {
	    		hmd.html("<div class='error'>" + data.message + "</div>");
	    	} else {
	    		hmd.html("<div class='info'>" + data.message + "</div>");
	    	}
	    	hmd.show().focus();
 		}
 	});
}
function dclear() {
 	$.ajax({
 		type: "GET",
 		url: "{{site.adminUrl}}cache/dbclear",
 		dataType: "json",
 		success: function(data){
 			var hmd = $("#hiddenMessage");
	    	if (data.type == "error") {
	    		hmd.html("<div class='error'>" + data.message + "</div>");
	    	} else {
	    		hmd.html("<div class='info'>" + data.message + "</div>");
	    	}
	    	hmd.show().focus();
 		}
 	});
}
</script>
{! endblock  !}